package com.itee.javafx;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by xin on 2014/4/27 0027.
 */
public final class ExecutorsUtils {

    private ExecutorService executorService;

    public static ExecutorsUtils getInstance() {
        return SingleHolder.INSTANCE;
    }

    public void execute(Runnable command) {
        executorService.execute(command);
    }

    private ExecutorsUtils() {
        executorService = Executors.newCachedThreadPool();
    }

    private static final class SingleHolder {
        private static final ExecutorsUtils INSTANCE = new ExecutorsUtils();
    }
}
